package com.ybkj.daijia.server.model;

import java.util.Date;

/**
 * 订单状态
 *
 * @author Shine
 */
public class OrderStatus extends Base {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private Order order;

    private Long orderId;

    private String content;// 事件内容

    private String memo;// 填写备注

    private String Color;// 对应前台显示颜色

    private StatusType statusType; // 事件类型

    private Date happened;

    public Date getHappened() {
        return happened;
    }

    public void setHappened(Date happened) {
        this.happened = happened;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public StatusType getStatusType() {
        return statusType;
    }

    public void setStatusType(StatusType statusType) {
        this.statusType = statusType;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }

    public String getColor() {
        switch (statusType) {
            case paidan:
                return "Blue";
            case quxiaopaidan:
                return "Red";
            case refuse:
                return "Orange";
            case refuseno:
                return "Red";
            case xiaodan:
                return "Red";
            case accept:
                return "Orange";
            case daokehu:
                return "Blue";
            case daijia:
                return "Blue";
            /*
             * case daomudi: return "Green";
             */
            case baodan:
                return "Orange";
            case wancheng:
                return "Blue";
            default:
                break;
        }

        return "";
    }

    public void setColor(String color) {
        Color = color;
    }

    public enum StatusType {
        /**
         * 新单
         */
        neworder,
        /**
         * 派单给司机
         */
        paidan,
        /**
         * 取消派单给司机
         */
        quxiaopaidan,
        /**
         * 销单
         */
        xiaodan,
        /**
         * 收回
         */
        revoke,
        /**
         * 接收订单
         */
        accept,
        /**
         * 到达客户地
         */
        daokehu,
        /**
         * 开始代驾(最后完成)
         */
        daijia,
        /**
         * 开始代驾(中途)
         */
        daijia2,
        /**
         * 结算完成
         */
        wancheng,
        /**
         * 司机拒单
         */
        refuse,
        /**
         * 司机申请销单 重新派单
         */
        refuseno,
        /**
         * 司机报单
         */
        baodan,
        /**
         * 司机补单
         */
        budan,
        /**
         * 修改金额
         */
        modifycash
    }

}
